package com.lc.usercenter.service;

import com.lc.usercenter.common.BaseResponse;
import com.lc.usercenter.model.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lc.usercenter.model.domain.request.UserRegisterRequest;
import org.springframework.http.HttpRequest;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户服务
* @author 罗超
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2024-11-20 01:37:36
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     * @param userRegisterRequest 用户信息
     * @return 新用户id
     */
    long userRegister(UserRegisterRequest userRegisterRequest, String validCode);

    /**
     * 用户登录
     *
     * @param userAccount  账户名
     * @param userPassword 密码
     * @param request 请求体
     * @return User(脱敏 ）
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);


    /**
     * 用户注销
     * @param request
     * @return
     */
    Integer logout(HttpServletRequest request);
    /**
     * 脱敏
     * @param user 查询的用户
     * @return 脱敏后的用户
     */
    User getSafatyUser(User user);

    Boolean sendCode(String phone);
}
